Move print backend list to configure.ac
authorMatthias Clasen <mclasen@redhat.com>
Mon, 1 Dec 2014 04:23:31 +0000 (23:23 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 1 Dec 2014 04:43:52 +0000 (23:43 -0500)
We already juggle the print backends here, might as well
produce the list.

configure.ac
gtk/Makefile.am

index 69adbe3db21a8d6d408944efcbdcf52c1997ef23..58163d84b8429f9d6651ae40f1f0737921f15242 100644 (file)
@@ -1462,6 +1462,7 @@ else
 
     PRINT_BACKENDS="$PRINT_BACKENDS cups"
     AM_CONDITIONAL(HAVE_CUPS, true)
+    have_cups=yes
 
     gtk_save_cflags="$CFLAGS"
     CFLAGS="$CUPS_CFLAGS"
@@ -1521,8 +1522,9 @@ else
   PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0], have_json_glib=yes, have_json_glib=no)
   if test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes"; then
     PRINT_BACKENDS="$PRINT_BACKENDS cloudprint"
+    have_cloudprint=yes
   fi
-  AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes")
+  AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_cloudprint" = "xyes")
 fi
 
 if test "x$enable_cloudprint" = "xyes" -a "x$have_rest" = "xno"; then
@@ -1537,8 +1539,6 @@ if test "x$enable_cloudprint" = "xyes" -a "x$have_json_glib" = "xno"; then
 ])
 fi
 
-AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
-
 gtk_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
 
@@ -1558,7 +1558,6 @@ fi
 
 CPPFLAGS="$gtk_save_cppflags"
 
-
 AC_ARG_ENABLE(test-print-backend,
               [AS_HELP_STRING([--enable-test-print-backend],
                               [build test print backend])],,
@@ -1572,6 +1571,21 @@ if test "$os_win32" = "yes"; then
   AC_CHECK_TYPES([IPrintDialogCallback],[],[],[[#include <windows.h>]])
 fi
 
+GTK_PRINT_BACKENDS="file"
+if test "$have_papi" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,papi"
+fi
+if test "$have_cups" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cups"
+fi
+if test "$have_papi" != "yes" -a "$have_cups" != "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,lpr"
+fi
+if test "$have_cloudprint" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cloudprint"
+fi
+AC_SUBST(GTK_PRINT_BACKENDS)
+
 ################################################################
 # Strip -export-dynamic from the link lines of various libraries
 ################################################################
index 86b69d62dfdf01029838fc64e6a4ace98ded241d..14a76a9a0c2ea1cf0c845d8f36f4b613819db904 100644 (file)
@@ -8,36 +8,6 @@ else
 GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
 endif
 
-if HAVE_CLOUDPRINT
-if HAVE_PAPI_CUPS
-GTK_PRINT_BACKENDS=file,papi,cups,cloudprint
-else
-if HAVE_CUPS
-GTK_PRINT_BACKENDS=file,cups,cloudprint
-else
-if HAVE_PAPI
-GTK_PRINT_BACKENDS=file,papi,cloudprint
-else
-GTK_PRINT_BACKENDS=file,lpr,cloudprint
-endif
-endif
-endif
-else
-if HAVE_PAPI_CUPS
-GTK_PRINT_BACKENDS=file,papi,cups
-else
-if HAVE_CUPS
-GTK_PRINT_BACKENDS=file,cups
-else
-if HAVE_PAPI
-GTK_PRINT_BACKENDS=file,papi
-else
-GTK_PRINT_BACKENDS=file,lpr
-endif
-endif
-endif
-endif
-
 AM_CPPFLAGS =                                          \
        -DG_LOG_DOMAIN=\"Gtk\"                          \
        -DGTK_LIBDIR=\"$(libdir)\"                      \